import { configUrl } from "../config/config"

export const generateUrl = (First,Second,Third,keyword,pageNum,pageSize) =>{
  let first = First.toJS();
  let second = Second.toJS();
  let third = Third.toJS();
  let query = [];
  for (let i =0;i<first.length;i++){
    if(first[i].condition==1){
      query.push(first[i].query);
      break;
    }
  }
  for (let i = 0;i<second.length;i++){
    if(second[i].condition==1){
      query.push(second[i].query);
      break;
    }
  }
  for (let i =0;i<third.length;i++){
    if(third[i].condition==1){
      query.push(third[i].query);
      break;
    }
  }
  let url = `${configUrl.searchDocument}?searchType=${query[0]}&searchContent=${query[1]}&searchTime=${query[2]}&keyword=${keyword}&pageNum=${pageNum}&pageSize=${pageSize}`
  return url;
}
